package com.wei.czz.common.vo.blog;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wei.czz.common.constant.RedisConstant;
import com.wei.czz.common.vo.common.BaseVo;
import lombok.Getter;
import lombok.Setter;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wei
 * date: 2021-05-14 11:29:00
 * className: UserBlogVo 用户检索自己博客请求表单Vo类
 * version: 1.0
 * description:
 */
@Getter
@Setter
public class UserBlogFormVo extends BaseVo {

    /**
     * 用户id
     * 注意：请求参数不包含该属性值，由程序内设置
     */
    private Long userId;

    /**
     * 博客-所属空间id
     */
    private String spaceId;

    /**
     * 博客-标签
     */
    private Integer label;

    /**
     * 博客-热门状态
     */
    private Integer hotStatus;

    /**
     * 博客-推荐状态
     */
    private Integer eliteStatus;

    /**
     * 博客-状态[0-保存 1-审核 2-下架 3-发布]
     */
    private Integer status;

    /**
     * 根据用户id，构造用户博客列表缓存键
     * 获取用户自己的博客列表缓存键
     * @return 键值
     */
    @JsonIgnore
    public String getUserBlogPageList() {
        return RedisConstant.USER_BLOG_LIST + RedisConstant.SPLIT + userId + RedisConstant.SPLIT + status
                + RedisConstant.SPLIT + spaceId + RedisConstant.SPLIT + word + RedisConstant.SPLIT + label
                + RedisConstant.SPLIT + hotStatus + RedisConstant.SPLIT + eliteStatus + RedisConstant.SPLIT
                + status + RedisConstant.SPLIT + page + RedisConstant.SPLIT + limit + RedisConstant.SPLIT
                + field + RedisConstant.SPLIT + order;
    }

    /**
     * 根据用户id，构造用户博客列表缓存键
     * @return 键值
     */
    @JsonIgnore
    public String getUserIssueBlogPageList() {
        return RedisConstant.USER_ISSUE_BLOG_LIST + RedisConstant.SPLIT + userId + RedisConstant.SPLIT + status
                + RedisConstant.SPLIT + spaceId + RedisConstant.SPLIT + word + RedisConstant.SPLIT + label
                + RedisConstant.SPLIT + hotStatus + RedisConstant.SPLIT + eliteStatus + RedisConstant.SPLIT
                + status + RedisConstant.SPLIT + page + RedisConstant.SPLIT + limit + RedisConstant.SPLIT
                + field + RedisConstant.SPLIT + order;
    }

}
